package com.aichat.ai_chatbackend.service;

import com.aichat.ai_chatbackend.model.entity.ChatSession;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author yuppie
* @description 针对表【chat_session(对话会话表)】的数据库操作Service
* @createDate 2025-07-13 14:40:37
*/
public interface ChatSessionService extends IService<ChatSession> {

    /**
     * 创建或者获取已有的session
     * @param sessionId
     * @param userId
     * @param characterId
     * @return
     */
    ChatSession getOrCreateSession(String sessionId,Long userId,Long characterId);


    /**
     * 创建会话管理
     * @param userId
     * @param characterId
     * @return
     */
    ChatSession createSession(Long userId, Long characterId);

    /**
     * 获取用户的会话
     * @param userId
     * @return
     */
    List<ChatSession> getUserSessions(Long userId);

    /**
     * 结束会话
     * @param sessionId
     */
    void endSession(String sessionId);

    /**
     *重试会话
     * @param sessionId
     */
    void resumeSession(String sessionId);

}
